package singleton.demo3;

import java.util.logging.Handler;

public class YaFactory {

    private static YaFactory yaFactory ;

    private YaFactory() {
    }
    public static YaFactory getInstance(){
        if (yaFactory == null) {
            yaFactory =  Helper.factory;
        }
        return yaFactory;
    }


    //静态内部类
    static class Helper {
        final static  YaFactory factory = new YaFactory();

    }
}
